@using Elsa.Studio.Workflows.UI.Contracts
@using Elsa.Studio.Workflows.Components.WorkflowDefinitionEditor.Components.ActivityProperties
@using Orientation = Radzen.Orientation

<RadzenSplitter Orientation="Orientation.Vertical" Style="height: calc(100vh - var(--mud-appbar-height));" Resize="@OnResize">
    <RadzenSplitterPane Size="70%">
        <DiagramDesignerWrapper @ref="_diagramDesigner" Activity="WorkflowDefinition!.Root" ActivitySelected="OnActivitySelected" IsReadOnly="true">
            <CustomToolbarItems>
                <MudTooltip Text="Download this version as a JSON file." Inline="false">
                    <MudIconButton Icon="@Icons.Material.Filled.FileDownload" OnClick="OnDownloadClicked">Download</MudIconButton>
                </MudTooltip>
                <MudText Typo="Typo.body1">@($"Version {WorkflowDefinition?.Version ?? 0}")</MudText>
            </CustomToolbarItems>
        </DiagramDesignerWrapper>
    </RadzenSplitterPane>
    <RadzenSplitterPane Size="30%" @ref="ActivityPropertiesPane">
        <ActivityPropertiesPanel @ref="ActivityPropertiesTab" WorkflowDefinition="@WorkflowDefinition" Activity="@SelectedActivity" ActivityDescriptor="@ActivityDescriptor" VisiblePaneHeight="@_activityPropertiesPaneHeight"/>
    </RadzenSplitterPane>
</RadzenSplitter>